<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title></title>	
		<link rel="stylesheet" href="../assets/css/core.css" />
		<link rel="stylesheet" href="../assets/css/menu.css" />
		<link rel="stylesheet" href="../assets/css/amazeui.css" />
		<link rel="stylesheet" href="../assets/css/component.css" />
		<link rel="stylesheet" href="../assets/css/page/form.css" />
		<link rel="stylesheet" type="text/css" href="layer.css">
	</head>
	<body>
		<div class="account-pages">
			<div class="wrapper-page">
				<div class="text-center">
	                <a class="logo">IT运维管理系统</a>
	            </div>
	            
	            <div class="m-t-40 card-box">
	            	<div class="text-center">
	                    <h4 class="text-uppercase font-bold m-b-0">Sign In</h4>
	                </div>
	                <div class="panel-body">
	                	<form class="am-form">
	                		<div class="am-g">
	                			<div class="am-form-group">
							      <input type="text" class="am-radius" id="username" placeholder="Username">
							    </div>
							    <div class="am-form-group form-horizontal m-t-20">
							      <input type="password" class="am-radius" id="password" placeholder="Password">
							    </div>
		                        <div class="am-form-group ">
		                        	<button type="button" class="am-btn am-btn-primary am-radius" style="width: 100%;height: 100%;" onclick='login()'>登录</button>
		                        </div>
	                		</div>
	                	</form>
	                </div>
	            </div>
			</div>
		</div>
		<script type="text/javascript" src="../assets/js/jquery-2.1.0.js" ></script>
		<script type="text/javascript" src="layer.js"></script>
		<script type="text/javascript">
			var login =function(){
				if (document.getElementById("username").value == ""
					|| document.getElementById("password").value == "") {
						layer.open({
		                    style:'top:-2rem',
		                    content: '用户名或密码不能为空！！！'
		                    ,skin: 'msg'
		                    ,time: 2 //2秒后自动关闭
		                });
						return false;
				}else{
					var login_name = $("#username").val();
					var password = $("#password").val();
					$.ajax({
						type:"POST",
						url:"../login/checkapp",
						data:{login_name:login_name,password:password},
						dataType:"Json",
						success:function(res){
							var info = res.info;
							if(info=="success"){
								window.location.href = "../order/person.html";
							}else if(info=="false"){
								layer.open({
				                    style:'top:-2rem',
				                    content: '用户名或密码错误'
				                    ,skin: 'msg'
				                    ,time: 2 //2秒后自动关闭
				                });
							}
						}
					});
				}
			}
		</script>
	</body>
</html>
